﻿#version 330
const vec3 Ambient = vec3(0.0, 0.0, 0.0);
const vec3 Diffuse = vec3(1.0, 1.0, 1.0);

uniform sampler2D Texture0;
uniform sampler2D Texture1;

in vec3 f_Position;
in vec2 f_TexCoord;

out vec4 out_Color;


void main(void)
{
    vec4 texColor0 = texture(Texture0, f_TexCoord);
	vec4 texColor1 = texture(Texture1, f_TexCoord);
	float a = texColor1.w;
	vec3 texColor = texColor0.xyz * (1-a) + a * texColor1.xyz;

    out_Color = vec4(Ambient + Diffuse * texColor, 1.0);
}

